package test;

import java.util.Scanner;

public class StudentGradeCalculation {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入王浩的 Java 课程成绩：");
        double javaGrade = scanner.nextDouble();
        System.out.print("请输入王浩的 SQL 课程成绩：");
        double sqlGrade = scanner.nextDouble();
        System.out.print("请输入王浩的 Php 课程成绩：");
        double phpGrade = scanner.nextDouble();
        // 计算 Java 课和 SQL 课的分数之差
        double difference = javaGrade - sqlGrade > 0 ? javaGrade - sqlGrade : sqlGrade - javaGrade;
        // 计算 3 门课的平均分
        double averageGrade = (javaGrade + sqlGrade + phpGrade) / 3;
        System.out.println("Java 课和 SQL 课的分数之差为：" + difference);
        System.out.println("3 门课的平均分为：" + averageGrade);
    }
}